<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/reset.css" rel="stylesheet" type="text/css" />
<link href="css/gird.css" rel="stylesheet" type="text/css" />
<link href="css/iehack.css" rel="stylesheet" type="text/css" />
<link href="css/header.css" rel="stylesheet" type="text/css" />
<link href="css/usercenter.css" rel="stylesheet" type="text/css" />

<script src="../js/jquery_last.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="../js/style/validator.css"></link>
<script src="../js/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="../js/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<script language="javascript" src="../js/DateTimeMask.js" type="text/javascript"></script>
<script defer="defer" src="../js/datepicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	//$.formValidator.initConfig({onerror:function(){alert("校验没有通过，具体错误请看错误提示")}});
	$.formValidator.initConfig({formid:"form1",onerror:function(msg){alert(msg)},onsuccess:function(){return true;}});
	$("#oldpassword").formValidator({onshow:"请输入密码",onfocus:"6-16个字符，请使用字母加数字或符号的组合密码，不能单独使用字母、数字或符号。",oncorrect:"密码合法"}).inputValidator({min:0,max:16,empty:{leftempty:false,rightempty:false,emptyerror:"密码两边不能有空符号"},onerror:"密码不能为空,请确认"})
	    .ajaxValidator({
	    type : "post",
		url : "../user/webUserEditCheckPsw.action?"+$("#oldpassword").value,
		datatype : "json",
		success : function(data){	
            if( data == "0" )
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#button"),
		error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
		onerror : "原密码错误请确认",
		onwait : "正在对用户名进行合法性校验，请稍候..."
	});
	$("#password1").formValidator({onshow:"请输入密码",onfocus:"6-16个字符，请使用字母加数字或符号的组合密码，不能单独使用字母、数字或符号。",oncorrect:"正确（若密码为空即为不修改密码）"}).inputValidator({min:0,max:16,empty:{leftempty:false,rightempty:false,emptyerror:"密码两边不能有空符号"},onerror:"密码不能为空,请确认"});
	$("#password2").formValidator({onshow:"请输入重复密码",onfocus:"两次密码必须一致",oncorrect:"密码一致"}).inputValidator({min:0,empty:{leftempty:false,rightempty:false,emptyerror:"重复密码两边不能有空符号"},onerror:"重复密码不能为空,请确认"}).compareValidator({desid:"password1",operateor:"=",onerror:"2次密码不一致,请确认"});
	$("#user_mail").formValidator({onshow:"请输入邮箱",onfocus:"邮箱6-100个字符,输入正确了才能离开焦点",oncorrect:"恭喜您,你输对了",forcevalid:true}).inputValidator({min:0,max:100,onerror:"你输入的邮箱长度非法,请确认"}).regexValidator({regexp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onerror:"你输入的邮箱格式不正确"})
		.ajaxValidator({
	    type : "get",
		url : "../user/webUserRegCheckmail2.action?"+$("#user_mail").value,
		datatype : "json",
		success : function(data){	
            if( data == "0" )
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#button"),
		error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
		onerror : "该邮箱已被注册",
		onwait : "正在对邮箱进行合法性校验，请稍候..."
	});
	
});

</script>
</head>

<body onload="setup()">
<div class="page">
  <jsp:include page="inc/header.jsp" />
  <div class="content">
    <div class="gird-s5c19">
      <div class="col-main">
        <h2>会员信息修改</h2>
        <ol class="progress step1">
          <li class="on"><a href="../user/webUserEdit.action"> 1.网站基本信息</a></li>
          
          <li><a href="../user/getPerUserView.action">2.高级会员信息</a></li>
        
          <s:if test="webUser.user_level==2">
          <li><a href="../user/getComUserView1.action?state=edit">3.企业会员信息</a></li>
          </s:if>
        </ol>
        <h3>修改用户网站基本信息：</h3>
        <div class="input">
          <form name="form1" id="form1" action="../user/webUserUpdate.action" method="post">
            <s:token/>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <th width="120">用户名：</th>
                <td width="350"><s:property value='webUser.user_name'/></td>
                <td></td>
              </tr>
              <tr>
                <th>原密码：</th>
                <td>
                	<input type="password" id="oldpassword" name="" value=""/>
                </td>
                <td><div id="oldpasswordTip"></div></td>
              </tr>
              <tr>
                <th>新密码：</th>
                <td>
					<input type="password" id="password1" name="webUser.user_password" value=""/>
				</td>
                <td><div id="password1Tip"></div> </td>
              </tr>
              <tr>
                <th>确认新密码：</th>
                <td><input name="password2" type="password" id="password2" value=""/></td>
                <td><div id="password2Tip"></div></td>
              </tr>
              <tr>
                <th>邮箱：</th>
                <td><input name="webUser.user_mail" type="text" id="user_mail" value="<s:property value='webUser.user_mail'/>"/>
                	<input type="hidden" id="user_mailbak" value="<s:property value='webUser.user_mail'/>"/>
                </td>
                <td><div id="user_mailTip"></div></td>
              </tr>
              
            </table>
        </div>
        <div class="btn"><button type="submit" class="next">修改完成,提交</button></div>
     </form>
      </div>
      <div class="col-sub">
        <div class="box">
          <div class="box-tp"></div>
          <div class="box-main">
            <h2>用户中心</h2>
            <ul>
              <li><a href="../user/getComRegState.action">申请企业会员</a></li>
              <li><a href="../user/webUserEdit.action">资料修改</a></li>
              <li><a href="../note/getNoteListByUser.action">我的消息</a></li>
              <li><a href="#">我要投稿</a></li>
              <li><a href="../user/UserLoginOut.action">退出</a></li>
            </ul>
          </div>
          <div class="box-bt"></div>
        </div>
      </div>
    </div>
  </div>
  <div class="footer"></div>
</div>
</body>
</html>
<!--js初始化函数-->
			<SCRIPT language="javascript">
			setup()
			</SCRIPT>
